package com.share.lottery.activity.caibotools;

import java.util.ArrayList;
import java.util.List;

import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.TextView;

import com.share.lottery.R;
import com.share.lottery.activity.JcMainActivtiy;
import com.share.lottery.adapter.BtjgAdapter;
import com.share.lottery.adapter.HomeGridAdapter;
import com.share.lottery.base.BaseActivity;
import com.share.lottery.base.BaseFragment;

/**
 * @author py
 *首页搜索 
 */
public class SeachGridFragment extends BaseFragment {
	private GridView gridView = null;
	private HomeGridAdapter adapter;
	private TextView tvQgc;//去购彩
	private View view;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		view = inflater.inflate(R.layout.search_grid_main, container,false);
		init();
		return view;
	}
	public void findView() {
		gridView = (GridView)view.findViewById(R.id.audio_list);
		tvQgc = (TextView) view.findViewById(R.id.tv_qgc);
	}


	public void getData() {

	}


//
//	private AlertDialog dialog;
//	private TextView titleTv;
//	public void initTitle() {
//		ImageButton titleLeftImg = (ImageButton) view.findViewById(R.id.title_left_img);
//		ImageButton titleRightImg = (ImageButton)view. findViewById(R.id.title_right_img);
//		titleTv = (TextView) view.findViewById(R.id.title_tv_center);
//		titleLeftImg.setOnClickListener(new OnClickListener() {
//
//
//			public void onClick(View arg0) {
//				finish();
//
//			}
//		});
//		titleLeftImg.setImageResource(R.drawable.back);
//		titleTv.setText("倍投结果");
//		titleRightImg.setVisibility(View.VISIBLE);
//		titleRightImg.setImageResource(R.drawable.home);
//		titleRightImg.setOnClickListener(new OnClickListener() {
//
//
//			public void onClick(View v) {
//				Intent intent = new Intent();
//				intent.setClass(getApplicationContext(), JcMainActivtiy.class);
//				startActivity(intent);
//				finish();
//
//			}
//		});
//	}

	public void setData() {
		if (adapter == null) {
			adapter = new HomeGridAdapter(getActivity());
		}
		gridView.setAdapter(adapter);
		List<Integer> datas = new ArrayList<Integer>();
		for (int i = 0; i < 5; i++) {
			datas.add(i);
		}
		adapter.addDatas(datas);
	}
//	private void showTs(){
//		dialog = new AlertDialog.Builder(SeachGridFragment.this).create();
//		dialog.setView(getLayoutInflater().inflate(R.layout.dialog_jsz, null));
//
//		dialog.show();
//	}

	public void onClick(View v) {

		switch (v.getId()) {
		case R.id.tv_qgc:
		
			break;

		default:
			break;
		}
	}
	public void setonCliker() {
		tvQgc.setOnClickListener(this);

	}

	@Override
	public void setOnClicker() {
		// TODO Auto-generated method stub

	}


}
